-
Notifications
You must be signed in to change notification settings - Fork 84
Add AsQobject trait #1262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add AsQobject trait #1262
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1262 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 73 73
Lines 12681 12681
=========================================
Hits 12681 12681 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
913c91b
to
3f749ed
Compare
3f749ed
to
9ed7e49
Compare
9ed7e49
to
c3061e8
Compare
@BenFordTytherington Didn't we at some point discuss just directly implementing QObjectExt for anything that is
That way we don't need another trait 🤔 We should then however make sure to move all methods from QObject into QObjectExt (even dump_object_info) |
Just attempted to implement it for all these upcasting types for a bit, and the main problem is that now QObject upcasts to QObject, so we get a conflicting impl. I think this is initially why we went for a separate trait, and a blanket impl there, since |
Why would we get a conflicting impl? |
A trait which will wrap the QObjectExt methods for types which upcast to QObject. When used in conjunction with #1252 and #1226, this will allow any type that inherits from QObject - even if this is through many levels of inheritance - to have an
as_qobject
method, and if the trait is imported, expose the methods of QObject directly on that child class. Closes #562.